<template>
<el-form-item :label="props.label" :style="style" class="form-item">
    <slot></slot>
</el-form-item>
</template>
<script setup>
import { onMounted,ref } from 'vue'
const props = defineProps({
    width: {
        type: String,
        default: "30%"
    },
    label: {
        default: ''
    },
    prop: {
        default: ''
    }
});
// 设置css样式
const style = ref({
    '--width':props.width
})
onMounted(()=>{
    console.log(props.label,props.prop)
})
</script>
<style scoped>
.form-item{
    margin-left: 20px;
    width: var(--width)
}
</style>